﻿using Newtonsoft.Json;
using Service.src.NW.Model.Folw;
using System.Collections.Generic;
using System.Diagnostics;

namespace Service.src.Model.Folw
{
    public class FlowRoot : FlowBaseEntity
    {
        [JsonIgnore]
        public bool IsRuning = false;

        [JsonProperty("id")]
        public long Id { get; set; }

        [JsonProperty("name")]
        public string name { get; set; }

        [JsonProperty("label")]
        public string label { get; set; }
        public bool hasErr { get; set; }

        /// <summary>
        /// 节点数+连线数
        /// </summary>
        public int nodeNumber { get; set; }

        public bool changed { get; set; }

        public Status status { get; set; }

        public List<NodeProcessor> processors { get; set; } = new List<NodeProcessor>();

        public List<Connection> connections { get; set; } = new List<Connection>();

        /// <summary>
        /// 流程总耗时
        /// </summary>
        public double FlowTotalSeconds { get; set; }

        [JsonIgnore]
        public List<NodeProcessor> TreeProcessors { get; set; } = new List<NodeProcessor>();

        /// <summary>
        /// 所有节点的输出参数
        /// </summary>
        [JsonIgnore]
        public static Dictionary<int, List<NodeOutParam>> AllNodeOutParmas { get; set; } = new Dictionary<int, List<NodeOutParam>>();

        [JsonIgnore]
        public Stopwatch stopwatch { get; set; }
    }

    public class Status
    {

        public bool show { get; set; }

        public string label { get; set; }

    }
}
